package com.weixin.service.impl;

import java.sql.SQLException;
import java.util.List;
import java.util.Map;

import com.weixin.dao.IZhuanZhangDAO;
import com.weixin.dao.impl.ZhuanZhangImpl;
import com.weixin.service.IZhuanZhangService;
import com.weixin.vo.Bank;
import com.weixin.vo.Users;
import com.weixin.vo.ZhuanZhang;

public class ZhuanZhangServiceImpl implements IZhuanZhangService{
	IZhuanZhangDAO zhuan = new ZhuanZhangImpl();
	/**
	 * 将zhuanzhangtable 里的数据遍历
	 * @return
	 * @throws SQLException 
	 */
	@Override
	public List<ZhuanZhang> selectAll() throws SQLException {
		
		return zhuan.selectAll();
	}
	
	/**
	 * 将bank_table里的数据遍历，制作成下拉框
	 * @return
	 * @throws SQLException
	 */
	@Override
	public List<Bank> findALl() throws SQLException {
		return zhuan.findALl();
	}
	
	/**
	 * 分页
	 * @param pageNum  页码
	 * @param pageSize  每页有几条数据
	 * @return
	 * @throws SQLException
	 */
	@Override
	public List<ZhuanZhang> findBySplit(int pageNum, int pageSize) throws SQLException {
		return zhuan.findBySplit(pageNum, pageSize);
	}

	/**
	 * 计算总条数
	 * @return
	 * @throws SQLException
	 */
	@Override
	public int findTotal() throws SQLException {
		return zhuan.findTotal();
	}

	
	/**
	 * g根据交易单号删除
	 * @param trade_id 交易单号
	 * @return
	 * @throws SQLException
	 */
	@Override
	public boolean removeById(int trade_id) throws SQLException {
		return zhuan.removeById(trade_id);
	}


	/**
	 * 删除一列数据
	 * @param trade_ids
	 * @return
	 * @throws SQLException
	 */
	@Override
	public boolean removeAll(String[] trade_ids) throws SQLException {
		return zhuan.removeAll(trade_ids);
	}

	/**
	 * 根据id寻找记录
	 */
	@Override
	public ZhuanZhang findById(int trade_id) throws SQLException {
		return zhuan.findById(trade_id);
	}

	/**
     * 带搜索分页
     * @param pageNum   页号
     * @param pageSize  页面大小
     * @param paramMap  所有参数
     * @return
     * @throws SQLException
     */
	@Override
	public List<ZhuanZhang> selectMemberInfo(String user_name, int pageNum, int pageSize) throws SQLException {
		return zhuan.selectMemberInfo(user_name, pageNum, pageSize);
	}

	  /**
     * 搜索到的东西总页面的
     * @param paramMap
     * @return
     * @throws SQLException
     */
	@Override
	public long selectMemberCount(String user_name) throws SQLException {
		return zhuan.selectMemberCount(user_name);
	}

	 /**
     * 往转账表里插入数据
     * @param vo
     * @return
     * @throws SQLException
     */
	@Override
	public boolean insert(ZhuanZhang vo) throws SQLException {
		return zhuan.insert(vo);
	}

	/**
     * 根据账号和密码修改余额
     * @param vo
     * @return
     * @throws SQLException
     */
	@Override
	public boolean update(Users vo) throws SQLException {
		return zhuan.update(vo);
	}


}
